<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>添加新路线</title>
  <style>
    body { font-family: Arial, sans-serif; margin: 20px; }
    .form-container { max-width: 600px; }
    .form-group { margin-bottom: 15px; }
    label { display: inline-block; width: 150px; }
    input[type="text"], input[type="number"], input[type="datetime-local"],
    textarea, select { width: 300px; padding: 8px; }
    textarea { height: 100px; }
    .btn { padding: 8px 15px; background-color: #4CAF50; color: white; border: none; cursor: pointer; }
    .btn:hover { background-color: #45a049; }
  </style>
</head>
<body>
<h1>添加新路线</h1>
<div class="form-container">
  <form action="${ pageContext.request.contextPath}/luxing/zengjia" method="post" enctype="multipart/form-data">
    <div class="form-group">
      <label for="name">路线名称:</label>
      <input type="text" id="name" name="name" required>
    </div>
    <div class="form-group">
      <label for="chufadi">出发地:</label>
      <input type="text" id="chufadi" name="chufadi" required>
    </div>
    <div class="form-group">
      <label for="mdidi">目的地:</label>
      <input type="text" id="mdidi" name="mdidi" required>
    </div>

    <div class="form-group">
      <label for="package_id">类型:</label>
      <select id="package_id" name="Fid" required>
        <option value="">请选择类型</option>
        <c:forEach items="${luxians}" var="fenlei">
          <option value="${fenlei.fid}">${fenlei.fname}</option>
        </c:forEach>
      </select>
    </div>
    <div class="form-group">
      <label for="price">价格:</label>
      <input type="number" id="price" name="jiage" step="0.01" min="0" required>
    </div>

    <div class="form-group">
      <label for="max_participants">最大参与人数:</label>
      <input type="number" id="max_participants" name="renshu" min="1" required>
    </div>

    <div class="form-group">
      <label for="status">状态:</label>
      <select id="status" name="zhuangtai" required>
        <option value="1">活跃</option>
        <option value="2">下架</option>
        <option value="3">已满</option>
      </select>
    </div>

    <div class="form-group">
      <label for="main_image">主图URL:</label>
      <input type="file" id="main_image" name="tupian">
    </div>
    <div class="form-group">
      <label for="images">商家:</label>
      <select id="images" name="sid" required>
        <option value="">请选择商家</option>
        <c:forEach items="${chashangjia}" var="shangjia">
          <option value="${shangjia.sid}">${shangjia.sname}</option>
        </c:forEach>
      </select>
    </div>


    <div class="form-group">
      <label for="days">天数:</label>
      <input type="number" id="days" name="tianshu" min="1" required>
    </div>
    <div class="form-group">
      <input type="submit" value="保存" class="btn">
    </div>
  </form>
</div>
</body>
</html>